import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 5040))
while True:
    s.send(input("客户端说：").encode())
    data = s.recv(1024)
    print("服务端回答：",data)

s.close()